///**
// * Alipay.com Inc.
// * Copyright (c) 2004-2018 All Rights Reserved.
// */
//package com.antcloud.demo.antscheduler;
//
//import java.util.Map;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.server.ServerHttpRequest;
//import org.springframework.http.server.ServerHttpResponse;
//import org.springframework.web.socket.WebSocketHandler;
//import org.springframework.web.socket.config.annotation.EnableWebSocket;
//import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
//import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
//import org.springframework.web.socket.server.HandshakeInterceptor;
//
///**
// *
// * @author qian.lqlq
// * @version $Id: WebSocketConfig.java, v 0.1 2018年09月05日 21:07 qian.lqlq Exp $
// */
//@Configuration
//@EnableWebSocket
//public class WebSocketConfig1 implements WebSocketConfigurer {
//    @Override
//    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
//        registry.addHandler(CmdHandler(), "/websocket").addInterceptors(new HandshakeInterceptor() {
//            @Override
//            public boolean beforeHandshake(ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse,
//                                           WebSocketHandler webSocketHandler, Map<String, Object> map) throws Exception {
//                return true;
//            }
//
//            @Override
//            public void afterHandshake(ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse,
//                                       WebSocketHandler webSocketHandler, Exception e) {
//
//            }
//        }).setAllowedOrigins("*"); //url和handler的mapping
//    }
//
//    @Bean
//    public WebSocketHandler CmdHandler() {
//        return new CmdHandler();
//    }
//}